#ifndef _COMPONENT_INFO_PANEL_H_
#define _COMPONENT_INFO_PANEL_H_

#include <memory>
#include "gui_frames.h"
#include "component_item.h"
#include "cell_data_item.h"

class CellDataItem;
class wxSheetEvent;
class wxSheetCellRenderer;

class ComponentInfoPanel : public ComponentInfoPanelBase
{
public:
  ComponentInfoPanel(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
    const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL);
  virtual ~ComponentInfoPanel();

  void ChangeItem(const CellDataItem& item);
  void PrepareGrid(const ComponentItem& itemData);
  void SetColumnCount(int newColumnNumber);
  void DropSelection();

private:
  void OnSelectionChanged(wxSheetEvent& event);
  void OnCaptionClicked(wxSheetEvent& event);
  void OnDummyFillBackground(wxEraseEvent& event);
  void OnRightMouseKey(wxSheetEvent& event);
  void TryChangeComponentLevel(int column);

  void OnSheetScroll(wxSheetEvent& event);
  void OnSheetResize(wxSizeEvent& event);

private:
  std::auto_ptr<wxSheetCellRenderer> BigCellRenderer;
  CellDataItem LastSelectedItem;
  bool StopNotification;

  DECLARE_EVENT_TABLE()
};

#endif // _COMPONENT_INFO_PANEL_H_
